# ----------------------------------------------------------------------
# Compiling
#
# Needs defining variables:
# CCOMPILER : compiler to use
# COPT      : compiler options
# LIBDIR    : target directory
# INCDIRS   : list of include directories
#
# Targets
#
# StabSolver.cpp
# ----------------------------------------------------------------------

# CPLEX
CPLEXDIR=/opt/ibm/ILOG/CPLEX_Studio_Academic123/cplex
CPLEXINCDIR=${CPLEXDIR}/include/ilcplex
CPLEXFLAGS  = -I$(CPLEXINCDIR)

INCFLAGS=$(addprefix -I,$(INCDIRS))

SOURCES= $(wildcard *.cpp)
OBJS= $(patsubst %.cpp, %.o, $(SOURCES))
DESTOBJS= $(patsubst %.o, $(LIBDIR)/%.o, $(OBJS))

all: $(DESTOBJS)

$(LIBDIR)/%.o: %.cpp 
	$(CCOMPILER) -c -o $@ ${COPT} -I. $(INCFLAGS) $< $(CPLEXFLAGS)
